package com.dfbz.设计模式.factory;

import org.junit.Test;

public class Demo02 {
    @Test
    public void test1(){

        FruitFactory fruitFactory=new FruitFactory();

        Fruit apple = fruitFactory.createFruit("apple");
        apple.getColor();

        Fruit pear = fruitFactory.createFruit("pear");
        pear.getColor();
    }
}
